package ooday03work;

public class AnimalTest {
    public static void main(String[] args) {
        Dog[] dogs = new Dog[3];
        dogs[0] = new Dog("小黑" , 2 ,"黑色");
        dogs[1] = new Dog("小白" , 1 ,"白色");
        dogs[2] = new Dog("小红" , 3 ,"红色");
        for (int i = 0; i < dogs.length; i++) {
            dogs[i].swim();
        }

        Chick[] chicks = new Chick[2];
        chicks[0] = new Chick("黄鸡" , 2 ,"黄色");
        chicks[1] = new Chick("红鸡" , 3 , "红色");
        for (int i = 0; i < chicks.length; i++) {
            chicks[i].layEggs();
        }

        Fish[] fish = new Fish[3];
        fish[0] = new Fish("黑鱼", 3 , "黑色");
        fish[1] = new Fish("红鱼", 4 , "红色");
        fish[2] = new Fish("黄鱼", 2 , "黄色");
        for (int i = 0; i < fish.length; i++) {
            for (int j = 0; j < fish.length; j++) {
                fish[i].eat();
            }
        }
    }
}
